package com.simple.datax.flow.preprocessor;

import java.util.HashMap;

import com.alibaba.dubbo.common.logger.Logger;
import com.alibaba.dubbo.common.logger.LoggerFactory;

/** 
 * @Title: PreProcessorAdaptor.java 
 * @Package com.simple.datax.flow.preprocessor 
 * @Description: TODO(预处理器适配器，根据企业ID获取对应的预处理器) 
 * @author tonney 
 * @date 2013-1-10 上午10:42:21 
 * @version V1.0 
 */
public class PreProcessorAdaptor {
	public Logger log = LoggerFactory.getLogger(this.getClass());
	private HashMap<String,PreProcessorService> preProcessorMap;

	public void setPreProcessorMap(
			HashMap<String, PreProcessorService> preProcessorMap) {
		this.preProcessorMap = preProcessorMap;
	}

	public PreProcessorService getPreProcessorServiceByEcode(String ecode){
		PreProcessorService preProcessorService = null;
		try{
			if(preProcessorMap!=null&&preProcessorMap.get(ecode)!=null){
				preProcessorService = preProcessorMap.get(ecode); 
			}
		}catch(Exception e){
			log.error("PreProcessorAdaptor::getPreProcessorServiceByEcode error=>"+e.toString());
		}
		return preProcessorService;
	}
}
